package com.firesrc.mail.search;

import java.io.IOException;
import java.util.HashSet;
import java.util.Set;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

public class SearchMailAsiaregisterImpl extends AbstractSearchMail {

	@Override
	public Set getMailListFromUrl(String url) {
		try {
			if (url.startsWith("www.")) {
				url = url.substring(4);
			}
			Document doc = Jsoup.connect("http://www.asiaregister.com/hk/whois.php?domain=" + url + "&x=15&y=7")
					.userAgent("Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0") // ����User-Agent
					.cookie("auth", "token") // ����cookie
					.timeout(10000) // �������ӳ�ʱʱ��
					.get();
			String text = doc.text();
			return getMailListFromText(text);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			System.out.println("连接网站错误:" + url);
		}
		return new HashSet<String>();
	}

}
